import {Effect} from "../../IEffectContainer";
import {ActorActionManager} from "../../../manager/ActorActionManager";

export class hpMax extends Effect {
    logLevel = "hpMax"

    apply(target: ActorActionManager) {
        super.apply(target)
        this.log.log(this.logLevel, '数据处理')
        this.remove(target)
        target.actorProperty.maxHp=target.actorProperty.maxHp*this.num[this.level-1]
        target.actorProperty.hp=target.actorProperty.maxHp
    }

    //不会调用
    remove(target: ActorActionManager) {
        this.log.log(this.logLevel, `当前最大生命值${target.actorProperty.maxHp},原始最大生命值${target.data.maxHp}`);
        target.actorProperty.maxHp=target.data.maxHp
        target.actorProperty.hp=target.data.hp
    }
}
